# Maintainer: Raymond Hackley <raymondhackley@protonmail.com>
pkgname=mint-themes
pkgver=2.1.1
pkgrel=0
pkgdesc="Mint themes for GNOME/GTK desktops"
options="!check" # It is a theme
url="https://github.com/linuxmint/mint-themes"
arch="noarch"
license="GPL-3.0-or-later"
depends="mint-x-theme mint-y-theme"
makedepends="python3 sassc"
source="$pkgname-$pkgver.tar.gz::https://github.com/linuxmint/mint-themes/archive/$pkgver.tar.gz"
subpackages="
	$pkgname-doc
	mint-x-theme:mint_x_theme
	mint-x-theme-gtk2:mint_x_theme_gtk2
	mint-x-theme-gtk3:mint_x_theme_gtk3
	mint-x-theme-gtk4:mint_x_theme_gtk4
	mint-x-theme-metacity:mint_x_theme_metacity
	mint-x-theme-xfwm4:mint_x_theme_xfwm4
	mint-y-theme:mint_y_theme
	mint-y-theme-gtk2:mint_y_theme_gtk2
	mint-y-theme-gtk3:mint_y_theme_gtk3
	mint-y-theme-gtk4:mint_y_theme_gtk4
	mint-y-theme-metacity:mint_y_theme_metacity
	mint-y-theme-xfwm4:mint_y_theme_xfwm4
	"

build() {
	make
}

package() {
	rm -rf "$builddir/usr/share/themes/Linux Mint" \
	       "$builddir"/usr/share/themes/*/cinnamon
	mkdir -p "$pkgdir"
	mv "$builddir"/usr "$pkgdir"/

	install -Dm644 "$builddir"/debian/changelog \
		       "$pkgdir"/usr/share/doc/"$pkgname"/changelog
	install -Dm644 "$builddir"/debian/copyright \
		       "$pkgdir"/usr/share/doc/"$pkgname"/copyright
}

mint_x_theme() {
	pkgdesc="Mint-X themes"
	depends=""
	amove usr/share/themes/Mint-X*/index.theme
}

mint_x_theme_gtk2() {
	pkgdesc="GTK+2.0 assets for Mint themes"
	depends="gtk-murrine-engine"
	install_if="mint-x-theme=$pkgver-r$pkgrel gtk+2.0"

	amove usr/share/themes/Mint-X*/gtk-2.0
}

mint_x_theme_gtk3() {
	pkgdesc="GTK+3.0 assets for Mint themes"
	depends=""
	install_if="mint-x-theme=$pkgver-r$pkgrel gtk+3.0"

	amove usr/share/themes/Mint-X*/gtk-3.0
}

mint_x_theme_gtk4() {
	pkgdesc="GTK+4.0 assets for Mint themes"
	depends=""
	install_if="mint-x-theme=$pkgver-r$pkgrel gtk4.0"

	amove usr/share/themes/Mint-X*/gtk-4.0
}

mint_x_theme_xfwm4() {
	pkgdesc="xfwm assets for Mint themes"
	depends=""
	install_if="mint-x-theme=$pkgver-r$pkgrel xfwm4"

	amove usr/share/themes/Mint-X*/xfwm4
}

mint_x_theme_metacity() {
	pkgdesc="metacity assets for Mint themes"
	depends=""
	install_if="mint-x-theme=$pkgver-r$pkgrel metacity"

	amove usr/share/themes/Mint-X*/metacity-1
}

mint_y_theme() {
	pkgdesc="Mint-Y themes"
	depends=""
	amove usr/share/themes/Mint-Y*/index.theme
}

mint_y_theme_gtk2() {
	pkgdesc="GTK+2.0 assets for Mint-Y themes"
	depends="gtk-murrine-engine"
	install_if="mint-y-theme=$pkgver-r$pkgrel gtk+2.0"

	amove usr/share/themes/Mint-Y*/gtk-2.0
}

mint_y_theme_gtk3() {
	pkgdesc="GTK+3.0 assets for Mint-Y themes"
	depends=""
	install_if="mint-y-theme=$pkgver-r$pkgrel gtk+3.0"

	amove usr/share/themes/Mint-Y*/gtk-3.0
}

mint_y_theme_gtk4() {
	pkgdesc="GTK+4.0 assets for Mint-Y themes"
	depends=""
	install_if="mint-y-theme=$pkgver-r$pkgrel gtk4.0"

	amove usr/share/themes/Mint-Y*/gtk-4.0
}

mint_y_theme_xfwm4() {
	pkgdesc="xfwm assets for Mint-Y themes"
	depends=""
	install_if="mint-y-theme=$pkgver-r$pkgrel xfwm4"

	amove usr/share/themes/Mint-Y*/xfwm4
}

mint_y_theme_metacity() {
	pkgdesc="metacity assets for Mint-Y themes"
	depends=""
	install_if="mint-y-theme=$pkgver-r$pkgrel metacity"

	amove usr/share/themes/Mint-Y*/metacity-1
}

sha512sums="
7692608dd0ac8e6f5d14b2f0332d40d215e4f07f9745a3bcc2bea099b7519d70d1a23aec853ca30191d04f133772cacae9fca38b3f6737b9afe916c696b08aaf  mint-themes-2.1.1.tar.gz
"
